﻿using Castle.Core.Logging;
using PlutoStudio.Log4Net;
using System;

namespace PlutoStudio
{
    public static class LoggingFacilityExtensions
    {
        public static Bootstrapper UseLog4Net(this Bootstrapper bootstrapper, string configFileName)
        {
            bootstrapper.IocManager.Register<ILoggerFactory, Log4NetLoggerFactory>(new Log4NetLoggerFactory(configFileName));
            return bootstrapper;
        }
        public static Bootstrapper UseLog4Net(this Bootstrapper bootstrapper)
        {
            bootstrapper.IocManager.Register<ILoggerFactory, Log4NetLoggerFactory>(Dependency.LifetimeScopeStyle.Singleton);
            return bootstrapper;
        }
    }
}
